Improve management of web sessions when connection changes#1808
Improve management of web sessions when connection changes#1808isc-bsaviano wants to merge 2 commits into
Conversation
| // For new ones, establish a connection? | ||
| // For orphans, logout and clear the cookies. | ||
| let refreshFilesExplorer = false; | ||
| const newConnections: Set<string> = new Set(); |
There was a problem hiding this comment.
const newConnections = new Set<string>(); is equivalent and more concise.
| if (affectsConfiguration("objectscript.conn") || affectsConfiguration("intersystems.servers")) { | ||
| if (affectsConfiguration("intersystems.servers")) { | ||
| // Gather the server names previously resolved | ||
| const resolvedServers: string[] = []; | ||
| resolvedConnSpecs.forEach((v, k) => resolvedServers.push(k)); | ||
| // Clear the cache | ||
| resolvedConnSpecs.clear(); | ||
| // Resolve them again, sequentially in case user needs to be prompted for credentials | ||
| for await (const serverName of resolvedServers) { | ||
| await resolveConnectionSpec(serverName); | ||
| } | ||
| } |
There was a problem hiding this comment.
First, thank you for this fix! It indeed fixes the problem I reported in #1805.
--
But I noticed one new problem: changes to a server in intersystems.servers no longer take effect until I reload the window.
Reproducable by:
- Connect normally. Set
"objectscript.outputRESTTraffic": trueto see the requests in the "ObjectScript" output. - In
intersystems.servers, change thewebServer.portof that server to a wrong/closed port and save. - The connection stays connected, and the output still shows requests going to the old port.
- Run "Developer: Reload Window". Only now the new port is used, and the connection fails (because the port is wrong).
On 3.8.2 the same change takes effect immediately, without a reload.
--
It looks like the old code re-read the server settings when intersystems.servers changed, and that part was removed in this PR. So the extension seems to keep using the old (cached) connection details until a reload. Maybe the fix needs to re-read / refresh the server spec for the changed servers again.
|
Thank you for the feedback @tobikrs. I believe I have addressed your issue. Please try this VSIX: |
This PR fixes #1805. I will implement a companion for Language Server as well.